import React from 'react';
import styles from './index.less';

export type TrendProps = {
  trend?: number;
  unit?: React.ReactNode;
  magnify?: boolean;
};

const Trend: React.FC<TrendProps> = ({ unit, trend, magnify, ...rest }) => {
  return (
    <div {...rest} className={styles.Trend}>
      <div className={styles.TrendTop}>价格</div>
      <span className={styles.TrendDown}>
        {magnify && <span style={{ color: '#00c783' }}>{trend || 0}元</span>}
        {!magnify && <span style={{ color: '#FF484C' }}>{trend || 0}元</span>}
      </span>
    </div>
  );
};

export default Trend;
